<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../taglibs.jsp" %>
<%@ include file="../easyuiLib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	function create(){
		$('#ff').form('submit',{
			url:"${ctx}/AddMenu",
			onSubmit:function(){
				return $('#ff').form('validate');
			},
			success:function(r){
				var json = eval('('+ r + ')');
				window.parent.refresh();
				$.messager.alert("标题",json.msg);
			}
		});
	}
	function clearhead(){
		document.getElementById('n').value='';
		document.getElementById('t').value='';
		$('#n').validatebox('validate');
		$('#t').validatebox('validate');
	}
</script>
</head>
<body>
	<div class="easyui-panel" title="创建头部菜单" style = "width:100%;height:100%;overflow:hidden" >
		<h2>根节点，用于创建头部菜单</h2>
		<form id="ff" method="post">
			<table cellpadding = "2">
				<tr>
					<th><span style="float:right">菜单名称:</span></th>
					<td><input id="n" class="easyui-validatebox textbox" data-options="required:true" name="name" /></td>
				</tr>
				<tr>
					<th><span style="float:right">菜单提示语:</span></th>
					<td><input id="t" class="easyui-validatebox textbox" data-options="required:true" name="title" /></td>
				</tr>
				<tr>
					<th><span style="float:right">图标:</span></th>
					<td><input class="easyui-validatebox textbox" data-options="required:true" name="icon" value="icon-head"/></td>
				</tr>
				<tr style="display:none;">
					<th>类型:</th>
					<td><input class="easyui-textbox" name="type" value="head" readonly="true"/></td>
				</tr>
				
				<tr>
					<td></td>
					<td align = "center"><a href="#" class="easyui-linkbutton" onclick="create()">创建</a> <a href="#" class="easyui-linkbutton" onclick="clearhead()">清空</a></td>
				</tr>
			</table>
		</form>
	</div>
	
</body>
</html>